gdk: Inherit the frame clock for popups
authorMatthias Clasen <mclasen@redhat.com>
Sun, 5 May 2019 22:59:51 +0000 (22:59 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 28 May 2019 20:25:15 +0000 (20:25 +0000)
With separate clocks, the phases are not coordinated,
which messes with GTKs size allocation machinery treating
the entire widget tree as a whole, and causes us to
run into assertion where popups get drawn before they
are allocated.

gdk/wayland/gdksurface-wayland.c
gdk/x11/gdksurface-x11.c

index f5c209cebe06be47efe4094949dd5c4c91117eb1..beea0dcdcd6818e3e4795dcb05b7c44ff21a372b 100644 (file)
@@ -510,7 +510,10 @@ _gdk_wayland_display_create_surface (GdkDisplay     *display,
   GdkWaylandSurface *impl;
   GdkFrameClock *frame_clock;
 
-  frame_clock = _gdk_frame_clock_idle_new ();
+  if (parent)
+    frame_clock = g_object_ref (gdk_surface_get_frame_clock (parent));
+  else
+    frame_clock = _gdk_frame_clock_idle_new ();
 
   surface = g_object_new (GDK_TYPE_WAYLAND_SURFACE,
                           "display", display,
index 1d6dee093a2ad9a94f8cd6a54a037300d2e20f3c..c4887c0fbcfbe51822e7a946b0fab6955d97139f 100644 (file)
@@ -809,7 +809,10 @@ _gdk_x11_display_create_surface (GdkDisplay     *display,
   x11_screen = GDK_X11_SCREEN (display_x11->screen);
   xparent = GDK_SCREEN_XROOTWIN (x11_screen);
 
-  frame_clock = _gdk_frame_clock_idle_new ();
+  if (parent)
+    frame_clock = g_object_ref (gdk_surface_get_frame_clock (parent));
+  else
+    frame_clock = _gdk_frame_clock_idle_new ();
 
   surface = g_object_new (GDK_TYPE_X11_SURFACE,
                           "display", display,